//
//  YYSoundCell.m
//  CollarMicrophone
//
//  Created by Yown on 2024/4/10.
//

#import "YYSoundCell.h"


#import <BIToolModule/BIProjectDefine.h>
#import <BIProjectModule/BIAppDefine.h>

@interface YYSoundCell ()

@property (weak, nonatomic) IBOutlet UILabel *soundLabel;

@end

@implementation YYSoundCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.backgroundColor = [UIColor loadColorFromString:@"#FFFFFF"];
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = 20;
    
    self.soundLabel.numberOfLines = 0;
    self.soundLabel.textAlignment = NSTextAlignmentCenter;
    self.soundLabel.textColor = [UIColor loadColorFromString:@"#333333"];
    self.soundLabel.font = BIFont(14);
}

- (void)setupName:(NSString *)name {
    self.soundLabel.text = BILocalizedString(name);
}

- (void)reloadSelected:(BOOL)isSelected {
    if (isSelected) {
        self.backgroundColor = [UIColor loadColorFromString:@"#4CB49E"];
        self.soundLabel.textColor = [UIColor loadColorFromString:@"#FFFFFF"];
    } else {
        self.backgroundColor = [UIColor loadColorFromString:@"#FFFFFF"];
        self.soundLabel.textColor = [UIColor loadColorFromString:@"#333333"];
    }
}

@end
